<template>
  <div class="brand">
    <h3>品牌制造商直供</h3>
    <ul>
      <li v-for="item in brandListArr" :key="item.id" @click="gotoDetail(item)">
        <!-- 注意这里src要动态绑定 -->
        <img v-lazy="item.pic_url" alt="" />
        <p class="p1">{{ item.name }}</p>
        <p class="p2">{{ item.floor_price | formatMoney }}</p>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "Brand",
  props: ["brandListArr"],
  data() {
    return {};
  },
  created() {
    // console.log(this);
  },
  methods: {
    gotoDetail(i) {
      this.$router.push({ path: "/xq", query: { id: i.id } });
    },
  },
};
</script>

<style lang='less' scoped>
.brand h3 {
  margin-top: 40px;
  text-align: center;
  margin-bottom: 10px;
}
.brand ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;

  li {
    position: relative;

    width: 49%;
    img {
      margin-top: 10px;
      width: 100%;
      display: block;
    }
    .p1 {
      font-size: 15px;
      position: absolute;
      bottom: 80px;
      left: 10px;
    }
    .p2 {
      position: absolute;
      color: red;
      font-size: 15px;
      bottom: 60px;
      left: 10px;
    }
  }
}
</style>